package com.yeban.javase.day06.test04_localtime;

import java.time.LocalDate;
import java.util.Scanner;

/**
 * @Desc TODO
 * @Author yeban
 * @Date 2025/10/14
 *
 * 7.输入任意一个年份，得到这年的2月份有几天？
 */
public class test07 {

    public static void main(String[] args) {

        System.out.print("请输入一个年份：");
        Scanner sc = new Scanner(System.in);
        int year = sc.nextInt();

        LocalDate today = LocalDate.now();
        LocalDate dayOfFebruary = today.of(year,2,1);   // 设置年月日
        System.out.println(year + "年2月份有" + dayOfFebruary.lengthOfMonth());

    }
}
